#-*- coding: utf-8 -*-
'''
Created on Aug 24, 2012

@author: bbg
'''

from sqlalchemy import Integer, Column, String, MetaData, Table
from sqlalchemy.orm import mapper
    
class Rights(object):
    '''
    操作权限的具体类型
    '''
    def __init__(self):
        self.note = ''
        self.name=''
        
    @staticmethod
    def doMapping():
        metaData = MetaData()
        rightsTable = Table('rights', metaData,
                           Column('id', Integer, primary_key = True),
                           Column('note', String), 
                           Column('name', String), 
                           schema="company_management")
        
        mapper(Rights, rightsTable)
        
# execute mapping
'''
默认做过mapper，后面使用不需要再进行mapper
'''
Rights.doMapping()